package com.bookshop.entity;

import java.io.Serializable;

/**
 * 设置统一服务端给客户端响应信息类
 *
 * @param <T>
 */
public class ResponseResult<T> implements Serializable {

    private int code;//响应状态码 200：成功，400：失败
    private String msg;//响应信息
    private T data;//响应数据

    public ResponseResult() { }

    public ResponseResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseResult(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
